package com.velpro.im.service.impl;

import com.velpro.im.mapper.IBaseMapper;
import com.velpro.im.service.BaseService;

import java.util.List;


public abstract class BaseServiceImpl<T> implements BaseService<T> {

	protected abstract IBaseMapper<T> getMapper();

	@Override
	public T selectByPrimaryKey(Object key) {
		return getMapper().selectByPrimaryKey(key);
	}

	@Override
	public boolean existsWithPrimaryKey(Object key) {
		return getMapper().existsWithPrimaryKey(key);
	}

	@Override
	public List<T> selectAll() {
		return getMapper().selectAll();
	}

	@Override
	public List<T> select(T record) {
		return getMapper().select(record);
	}

	@Override
	public T selectOne(T record) {
		return getMapper().selectOne(record);
	}

	@Override
	public int selectCount(T record) {
		return getMapper().selectCount(record);
	}

	@Override
	public List<T> selectByIds(String ids) {
		return getMapper().selectByIds(ids);
	}
}
